package mr.ali.video.web.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import mr.ali.video.web.model.CollectionPlayUrl;
import mr.ali.video.web.mapper.CollectionPlayUrlMapper;
import mr.ali.video.web.service.ICollectionPlayUrlService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Mr-ali
 * @since 2025-08-03
 */
@Service
public class CollectionPlayUrlServiceImpl extends ServiceImpl<CollectionPlayUrlMapper, CollectionPlayUrl> implements ICollectionPlayUrlService {
@Resource
private CollectionPlayUrlMapper collectionPlayUrlMapper;

    @Override
    public List<CollectionPlayUrl> selectByCollectionId(Integer videoId) {
        QueryWrapper<CollectionPlayUrl> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("video_id", videoId);
        queryWrapper.orderByAsc("video_ji");
        return collectionPlayUrlMapper.selectList(queryWrapper);
    }
    @Override
    public void insert(CollectionPlayUrl collectionUrl) {
        collectionPlayUrlMapper.insert(collectionUrl);
    }

}
